package cn.bluech.lib.utils;

import android.app.Activity;
import android.os.Build;
import android.view.Window;
import android.view.WindowManager;



/**
 * Description: 状态栏工具类
 * Create by Codeant on 2018/10/19.
 */
public class StatusBarUtils {
    public static void setColor(Activity activity, int colorId){
        if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.LOLLIPOP){
            Window window = activity.getWindow();
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(activity.getResources().getColor(colorId));
        }
    }
}
